#Figure 1#
load("Figure1.Rdata")
lm<-lm(amnest_prov~log(battle_deaths+1)+log(reb_killings+1),
       data=data)
test<-coeftest(lm, vcov= cluster.vcov(lm, cluster=data$id))
ci<-confint(test)
plot<-cbind.data.frame(coef(lm)[2:3], ci[2:3,])
colnames(plot)<-c("point", "lb", "ub")
plot$pos<-c(2,1)
plot$pos<-factor(plot$pos, levels=c(2,1), labels=c("Battle Deaths",
                                    "Civilian Killings by Rebels"))
head(plot)

fig1<-ggplot(plot, aes(reorder(pos, point), point))+
  geom_point(cex=4)+
  geom_linerange(aes(ymin=lb, ymax=ub), cex=1)+
  xlab("")+
  scale_y_continuous(breaks=c(-.05,0,.05))+
  ylab("Regression Coefficients")+
  geom_hline(yintercept=0)+
  coord_flip()+
  theme_grey(base_size=14)

fig1
pdf(file="Fig1.pdf", width=6, height=2)
print(fig1)
dev.off()

rm(list=setdiff(ls(), c("cluster_bootstrap", "int_plot")))
